package com.sdp.wx.db.wx_contract_detail.service.impl;

import com.sdp.core.bizc.db.IViewQuery;
import com.sdp.wx.db.wx_contract_detail.entity.WxContractDetail;
import com.sdp.wx.db.wx_contract_detail.mapper.WxContractDetailMapper;
import com.sdp.wx.db.wx_contract_detail.service.IWxContractDetailService;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author zsp
 * @since 2024-01-08
 */
@Service
public class WxContractDetailServiceImpl extends ServiceImpl<WxContractDetailMapper, WxContractDetail> implements IWxContractDetailService,IViewQuery {

	@Autowired
	private WxContractDetailMapper wxContractDetailMapper;
	
	@Override
	public void removeWxContractDetail(String contractCode) {
		LambdaQueryWrapper<WxContractDetail> queryWrapper = new LambdaQueryWrapper<>();
		queryWrapper.eq(WxContractDetail::getContractCode, contractCode);
		remove(queryWrapper);
	}

	
	@Override
	public <T> List<T> viewList(QueryWrapper<T> queryWrapper) {
		return wxContractDetailMapper.viewList(queryWrapper);
	}

	@Override
	public <T> int viewCount(QueryWrapper<T> queryWrapper) {
		return wxContractDetailMapper.viewCount(queryWrapper);
	}

	@Override
	public <T> IPage<T> viewPage(IPage<T> page, QueryWrapper<T> queryWrapper) {
		return wxContractDetailMapper.viewPage(page, queryWrapper);
	}
}
